
		<div style="margin-left: 10px;">
			<form id="trend_form">
				<input id="startTime" name="startTime" value="${startTime! }" class="easyui-datebox theme-textbox-radius" style="height: 32px;width:130px;text-align: center;">
				<span>~</span>
				<input id="endTime" name="endTime" value="${endTime! }" class="easyui-datebox theme-textbox-radius"  style="height: 32px;width:130px;text-align: center;">
			</form>
		</div>
		<div id="lineChart" style="width:100%;height: 80%;margin-top: 20px;"></div>
	<script>
	$(document).ready(function() {
		
		$('#startTime').datebox({
			onSelect: function(date){
				initTrend();
			}
		});
		$('#endTime').datebox({
			onSelect: function(date){
				initTrend();
			}
		});
	});
	
	function initTrend(){
		var data = sy.serializeObject($("#trend_form"));
		var url = "/salesDetail";
		common_ajax.ajaxDiv('trend_div', url, data);
	}
	/*折线图*/
	require.config({
	        paths: {
	            echarts: 'http://echarts.baidu.com/build/dist'
	        }
	    });
	     require(
	    [
	        'echarts',
	        'echarts/chart/bar',
	        'echarts/chart/line'
	    ],
	    function (ec) {
	        var myChart = ec.init(document.getElementById('lineChart')); 
	        option = {
			    tooltip : {
			        trigger: 'axis',
			        axisPointer : {      
			            type : 'shadow'
			        }
			    },
			    legend: {
			        data:['减重销售额','产品销售额']
			    },
			    toolbox: {
			        show : true,
			        orient: 'vertical',
			        x: 'right',
			        y: 'center',
			        feature : {
			            dataView : {
			            	show : true,
			                title : '数据视图',
			                readOnly: true,
			                lang : ['数据视图', '关闭'],
			                optionToContent: function(opt) {
			                    var axisData = opt.xAxis[0].data;
			                    var series = opt.series;
			                    var table = '<table style="width:100%;text-align:center"><tbody><tr>'
			                                 + '<td>时间</td>'
			                                 + '<td>' + series[0].name + '</td>'
			                                 + '<td>' + series[1].name + '</td>'
			                                 + '</tr>';
			                    for (var i = 0, l = axisData.length; i < l; i++) {
			                        table += '<tr>'
			                                 + '<td>' + axisData[i] + '</td>'
			                                 + '<td>' + series[0].data[i] + '</td>'
			                                 + '<td>' + series[1].data[i] + '</td>'
			                                 + '</tr>';
			                    }
			                    table += '</tbody></table>';
			                    return table;
			                }
			            },
			            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']}
			        }
			    },
			    calculable : true,
			    xAxis : [
			        {
			            type : 'category',
			            axisLabel: {
							rotate: 35
						},
			            boundaryGap : false,
			            data : [
												<%												
												if(!isEmpty(dates)){
													for(var i=0;i<dates.~size;i++){
														if(i == dates.~size - 1){ 
															print('\'' + dates[i] + '\'');
														}else{
															print('\'' + dates[i] + '\',');
														}
													}
												}
												%>
	
			                    ]
			        }
			    ],
			    yAxis : [
			        {
						axisLabel : {
			                formatter: '{value} 元'
			            }
			        }
			    ],
			    series : [
			        {
			            name:'减重销售额',
			            type:'line',
			            data:[
								<%
								if(!isEmpty(weightSales)){
									for(var i=0;i<weightSales.~size;i++){
										if(i == weightSales.~size - 1){
											print(weightSales[i]);
										}else{
											print(weightSales[i] + ',');
										}
									}
								}
								%>
			                 ]
			        },
			        {
			            name:'产品销售额',
			            type:'line',
			            data:[
								<%
								if(!isEmpty(productSales)){
									for(var i=0;i<productSales.~size;i++){
										if(i == weightSales.~size - 1){
											print(productSales[i]);
										}else{
											print(productSales[i] + ',');
										}
									}
								}
								%>
			                 ]
			        }
			    ]
			}; 
	        myChart.setOption(option); 
	        window.onresize = myChart.resize;
	    }
	); 
	</script>